package com.wolfalpha.utron.activity.base;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.umeng.analytics.MobclickAgent;
import com.wolfalpha.utron.R;
import com.wolfalpha.utron.app.AppManager;

/**
 * 包含了头部左侧和中部的Activity
 * <p/>
 * Created by luodon on 15/8/18.
 */
public class BaseCenterActivity extends Activity {

    private ImageView ivBack;               //返回按钮

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AppManager.getAppManager().addActivity(this);
    }

    /**
     * 初始化头部界面
     */
    public void initHead() {
        ivBack = (ImageView) findViewById(R.id.header_iv_back);

        ivBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        AppManager.getAppManager().finishActivity(this);
    }

    public void onResume() {
        super.onResume();
        //友盟统计
        MobclickAgent.onResume(this);
    }

    public void onPause() {
        super.onPause();
        //友盟统计
        MobclickAgent.onPause(this);
    }
}
